import { Inject, Controller, Get, Post,Param} from '@midwayjs/core';
import { Context } from '@midwayjs/koa';
import { UserService } from '../../service/admin/user.service';

@Controller('/api/admin')
export class APIController {
      @Inject()
      ctx: Context;

    @Inject()
    userService: UserService;

    @Get('/getAllUsers', { description: '获取所有用户信息' })
    async getAllUsers(){
        const result = await this.userService.getAllUsers()
        return { success: true, message: '获取所有用户信息成功', result }
    }

    @Post('/deleteUser/:id', { description: '删除用户' })
    async deleteUser(@Param() Param){
        const result = await this.userService.deleteUser(Param.id)
        return { success: true, message: '删除用户成功', result }
    }



}